#!/bin/sh
port=8000
app=xxx-eureka-server-0.0.1-SNAPSHOT.jar
#查找进程
echo "Stopping SpringBoot Application"
pid=`ps -ef | grep ${app} | grep -v grep | awk '{print $2}'`
if [ -n "$pid" ]
then
	#优雅关闭
	curl -X POST 127.0.0.1:${port}/actuator/shutdown
	#等待10秒
	sleep 10s
	#容错处理（强制关闭）
	kill -9 $pid
fi
echo "Stopped SpringBoot Application"
